<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>餐饮后台管理系统-- 菜单管理</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0,maximum-scale=1.0, user-scalable=no" />
    <link rel="stylesheet" href="${pageContext.request.contextPath}/admin/static/font-awesome-4.7.0/css/font-awesome.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/admin/static/css/all.css" type="text/css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/admin/static/css/index.css" type="text/css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/admin/static/css/cuisineList.css" type="text/css" />
<!--     <link rel="stylesheet" href="https://apps.bdimg.com/libs/bootstrap/3.2.0/css/bootstrap.min.css">-->
    <script src="${pageContext.request.contextPath}/admin/static/js/down.js" type="text/javascript"></script>
    <script src="${pageContext.request.contextPath}/admin/static/js/menu.js" type="text/javascript"></script>
    <script src="${pageContext.request.contextPath}/admin/static/js/userbox.js" type="text/javascript"></script>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
    <style>
        img {
            width: 40px;
            height: 30px;
        }
        .msg {
            width: 600px;
            text-align: center;
            color: red;
            font-size: 14px;
            margin: 0 auto;
        }

        .pageIndex {
            width: 600px;
            text-align: center;
            margin: 30px auto;
        }

        .pageIndex a {
            width: 30px;
            height: 30px;
            display: inline-block;
            text-align: center;
            line-height: 30px;
            -color: #009688;
            colorbackground: white;
            text-decoration: none;
        }

        .active {
            background-color: #FF5722 !important;
        }
        .list{
            width: 96%;
            margin: 30px auto;
        }
        .table{
            margin: auto;
            text-align: center;
            width: 90%;
            height: 100%;
        }
        .sorting{
            /*width: 100%;*/
        }
        .menu_tb{
            /*background: #93D1FF;*/
            height: 75px;
            line-height: 75px;
            padding: 5px !important;
            margin: 5px !important;
            text-align: center;
        }
        body {
            color: #777777;
            background:#FFFFFF;

        }
        .text-home {
            height: 200px;
            color: #12101f;
            text-align: center;
            margin-top: 245px;
            font-size: 45px;
            font-weight: bold;
        }

        .text-home p {
            line-height: 40px;
            margin-bottom: 20px;
        }
        .nav {
            height: 100%;
            position: relative;
            overflow: hidden;
            width: 100%;
            margin-bottom: 0;
            padding-left: 0;
            list-style: none;
        }
        .sidebar-left {
            top: 60px;
            bottom: 0;
            left: 0;
            padding-bottom: 50px;
            position: fixed;
            background: #302b63;

            vertical-align: top;
            width: 300px;
        }

        .page-header {

            background: #302b63;

        }
        .sidebar-left .sidebar-header .sidebar-toggle{
            background-color: #6576ba;
        }
        a{
            color: #966bbf;
        }

    </style>
</head>

<body>
    <section class="body" onclick="menu()">
        <header class="header">
            <div class="header-left logo-con">
                <a href="${pageContext.request.contextPath}/admin/index" class="logo">FOOD</a>
            </div>
            <div class="header-right">
              <span class="separator"></span>
                <div id="button" class="userbox">
                    <a href="#" data-toggle="dropdown">
                        <figure class="profile-picture">
                            <img src="static/images/user.jpg" alt="舒克·张" class="img-circle" data-lock-picture="头像">
                        </figure>
                        <div class="profile-info" data-lock-name="舒克" data-lock-email="337828925@qq.com">
                            <span class="name">
									<font style="vertical-align: inherit;">${admin.adminName}</font>
								</span>
                            <span class="role">
									<font style="vertical-align: inherit;">营业额:￥${admin.turnover}</font>
								</span>
                        </div>
                        <i style="font-size:18px;font-weight: bold;color: #777777;" class="fa">&#xf107</i>
                    </a>
                    <div class="dropdown-menu">
                        <ul class="list-unstyled">
                            <li class="divider"></li>
                            <li>
                                <a href="${pageContext.request.contextPath}/admin/adminRegister">
                                    <i style="font-size:24px" class="fa">&#xf007</i>
                                    <font style="vertical-align: inherit;">注册</font>
                                </a>
                            </li>
                            <li>
                                <a href="${pageContext.request.contextPath}/admin/adminLogout">
                                    <i style="font-size:24px" class="fa">&#xf011</i>
                                    <font style="vertical-align: inherit;" type="button" id="logout">退出</font>
                                </a>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </header>
        <!-- <div class="inner-wrapper"> -->
        <aside id="sidebar-left" class="sidebar-left">
            <div class="sidebar-header">
                <div class="sidebar-toggle">
                    <a href="${pageContext.request.contextPath}/admin/index">
                        <i style="font-size:20px" class="fa">&#xf00b</i>
                    </a>
                </div>
            </div>
            <div class="nav scrollbar">
                <div class="nav-content">
                    <nav id="menu" role="navigation">
                        <ul class="nav-main" id="list">
                            <li class="nav-parent">
                                <a>
                                    <i style="font-size:24px" class="fa">&#xf0f6</i>
                                    <span>
                                            <font style="vertical-align: inherit;"> 菜单管理</font>
                                    </span>
                                </a>
                                <ul class="nav nav-children">
                                    <li>
                                        <a href="${pageContext.request.contextPath}/admin/cuisineList" id="page_1">
                                            <font style="vertical-align: inherit;">菜单列表</font>
                                        </a>

                                    </li>
                                    <li>
                                        <a href="${pageContext.request.contextPath}/admin/cuisineAdd" id="page_2">
                                            <font style="vertical-align: inherit;">添加菜单</font>
                                        </a>
                                    </li>
                                </ul>
                            </li>
                            <li >
                                <a href="${pageContext.request.contextPath}/admin/cartList">
                                    <i class="fa fa-shopping-cart" style="font-size: 24px" aria-hidden="true"></i>
                                    <span>
                                        <font style="vertical-align: inherit;">购物车</font>
                                    </span>
                                </a>

                            </li>
                            <li class="nav-parent">
                                <a>
                                    <i style="font-size:24px" class="fa">&#xf2c0</i>
                                    <span>
                                        <font style="vertical-align: inherit;">订单管理</font>
                                    </span>
                                </a>
                                <ul class="nav nav-children">
                                    <li>
                                        <a href="${pageContext.request.contextPath}/admin/orderList?index=1&payFlag=1">
                                            <font style="vertical-align: inherit;">已支付订单</font>
                                        </a>
                                        <a href="${pageContext.request.contextPath}/admin/orderList?index=1&payFlag=0">
                                            <font style="vertical-align: inherit;">未支付订单</font>
                                        </a>
                                    </li>
                                </ul>
                            </li>
                            <li class="nav-parent">
                                <a>
                                    <i style="font-size:24px" class="fa">&#xf2c0</i>
                                    <span>
                                        <font style="vertical-align: inherit;">分类管理</font>
                                    </span>
                                </a>
                                <ul class="nav nav-children">
                                    <li>
                                        <a href="${pageContext.request.contextPath}/admin/categoryAdd">
                                            <font style="vertical-align: inherit;">添加分类</font>
                                        </a>
                                    </li>
                                    <li>
                                        <a href="${pageContext.request.contextPath}/admin/categoryList">
                                            <font style="vertical-align: inherit;">分类列表</font>
                                        </a>
                                    </li>
                                </ul>
                            </li>
                        </ul>
                    </nav>
                </div>
            </div>
        </aside>
            <section class="content-body">
                <header class="page-header">
                    <h2>菜单</h2>
                </header>
                <section class="panel" id="menuOne" style="display: block;">
                    <header class="panel-heading">
                    </header>
                    <div class="panel-body">
                        <div class="row">
                            <div class="con-head">
                                <button  class="btn-primary" style="background-color: #302b63;">
                                    <a href="${pageContext.request.contextPath}/admin/cartList" style="color: white">
                                        <p></p><p></p>
                                        购物车
                                    </a>
                                </button>
                            </div>
                        </div>
                        <div class="dataTables-wrapper">
                            <div class="table-responsive">
                                <table class="table"align="center">
                                        <tr align="center">
                                            <td>编号</td>
                                            <td>菜名</td>
                                            <td>价格</td>
                                            <td>菜品类型</td>
                                            <td>菜品图片</td>
                                            <td>操作</td>
                                        </tr>
                                    <tbody class="menu_tb" id="tad">
                                        <c:forEach items="${page.list}" var="cuisine" varStatus="status">
                                            <tr >
                                                <td align="center">${status.index+1}</td>
                                                <td style="width: 100px">${cuisine.cuisineName}</td>
                                                <td align="center" style="width: 100px">${cuisine.cuisinePrice}</td>
                                                <td align="center" >${cuisine.categoryName}</td>
                                                <td align="center"><img style="width: 160px;height: 85px;align-items: center;margin-left:9px " src="${cuisine.cuisinePhoto}"/></td>
<%--                                                删除--%>
                                                <td align="center" valign="middle" style="height: 85px; display: flex">
                                                    <a href="${pageContext.request.contextPath}/admin/cuisineDelete?id=${cuisine.cuisineId}"><i style=" margin-left:120px;margin-right:20px;font-size:18px;flex-direction: column;justify-content: space-between;align-items: center;line-height: 85px" class="fa">&#xf014</i></a>&nbsp;&nbsp;
                                                    <a href="${pageContext.request.contextPath}/admin/cuisineFind?id=${cuisine.cuisineId}"><i style="margin-left:35px;margin-right:20px; font-size:18px;flex-direction: column;justify-content: space-between;align-content: space-between;line-height: 85px" class="fa">&#xf040</i></a>
                                                    <a href="${pageContext.request.contextPath}/admin/cartAdd?cuisineId=${cuisine.cuisineId}"><i style="margin-left:35px;margin-right:20px; font-size:18px;line-height: 85px" class="fa">&#xf07a</i></a>
                                                </td>
                                            </tr>
                                        </c:forEach>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="pageIndex">
                            <c:forEach items="${page.pageIndex}" var="item">
                                <c:if test="${item ne '...'}">
                                    <c:if test="${(page.currentIndex eq item) && !(empty item) }">
                                        <a class="active" href="${pageContext.request.contextPath}/admin/cuisineList?index=${item}">${item}</a>
                                    </c:if>
                                    <c:if test="${page.currentIndex ne item && !(empty item)}">
                                        <a href="${pageContext.request.contextPath}/admin/cuisineList?index=${item}">${item}</a>
                                    </c:if>
                                </c:if>
                                <c:if test="${item eq '...'}">
                                    <a href="">${item}</a>
                                </c:if>
                            </c:forEach>
                        </div>
                        <div style="width: 600px;text-align: center;margin: 0 auto">当前第${page.currentIndex}页，共${page.totalPage}页</div>
                    </div>
                </section>
            </section>
        </div>
    </section>